package com.example.taximeter.bean;


import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 角色信息
 */
public class Role {

    @NotNull(message = "角色id格式错误", groups =  GroupUpdate.class)
    private Integer roleid;

    @NotNull(message = "角色名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "角色名称不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 0, max = 50, message = "角色名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String rolename;

    private List<Integer> privilegeidList;

    @Override
    public String toString() {
        return "Role{" +
                "roleid=" + roleid +
                ", rolename='" + rolename + '\'' +
                ", privilegeidList=" + privilegeidList +
                '}';
    }

    public List<Integer> getPrivilegeidList() {
        return privilegeidList;
    }

    public void setPrivilegeidList(List<Integer> privilegeidList) {
        this.privilegeidList = privilegeidList;
    }

    public Integer getRoleid() {
        return roleid;
    }

    public void setRoleid(Integer roleid) {
        this.roleid = roleid;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }
}
